import { createSlice } from '@reduxjs/toolkit'

export interface ITagList {
    label: string
    path: string
    search?: string
}
interface TagListState  {
    tagList: ITagList[]
}
//该store分库的初始值
const initialState: TagListState= {
    tagList: []
}

export const tagList = createSlice({
    name: 'tagList',
    initialState,
    reducers: {
        setTagList: (state, action) => {
            state.tagList = action.payload
        }
    },
})

export const { setTagList } = tagList.actions

export default tagList.reducer